xen/domain: Allocate d->vcpu[] in domain_create()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Mar 2018 17:07:50 +0000 (17:07 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 31 Aug 2018 11:06:53 +0000 (12:06 +0100)
commit61649709421a5a7c1a9fbb45cd8ff15a299bf6ee
tree637436d64dc7e8710249352688e3611170ce9524
parent1aea974f04806a74592e0b3cf063e4b47a922b9b
xen/domain: Allocate d->vcpu[] in domain_create()

For ARM, the call to arch_domain_create() needs to have completed before
domain_max_vcpus() will return the correct upper bound.

For each arch's dom0's, drop the temporary max_vcpus parameter, and allocation
of dom0->vcpu.

With d->max_vcpus now correctly configured before evtchn_init(), the poll mask
can be constructed suitably for the domain, rather than for the worst-case
setting.

Due to the evtchn_init() fixes, it no longer calls domain_max_vcpus(), and
ARM's two implementations of vgic_max_vcpus() no longer need work around the
out-of-order call.

From this point on, d->max_vcpus and d->vcpus[] are valid for any domain which
can be looked up by domid.

The XEN_DOMCTL_max_vcpus hypercall is modified to reject any call attempt with
max != d->max_vcpus, which does match the older semantics (not that it is
obvious from the code).  The logic to allocate d->vcpu[] is dropped, but at
this point the hypercall still needs making to allocate each vcpu.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/domain_build.c
xen/arch/arm/setup.c
xen/arch/arm/vgic.c
xen/arch/arm/vgic/vgic.c
xen/arch/x86/dom0_build.c
xen/arch/x86/setup.c
xen/common/domain.c
xen/common/domctl.c
xen/common/event_channel.c
xen/include/public/domctl.h
xen/include/xen/domain.h